package com.yuanfengerp.IncomeItem.controller;


import com.yuanfengerp.IncomeItem.entity.IncomeItemInfo;
import com.yuanfengerp.IncomeItem.service.impl.IncomeItemInfoServiceImpl;
import com.yuanfengerp.publicUtil.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class IncomeItemInfoController {
    @Autowired
    private IncomeItemInfoServiceImpl iiisi;
    @PostMapping("/deleteByPrimaryKey")
    public Result<String> deleteByPrimaryKey(String income_ID){
        return iiisi.deleteByPrimaryKey(income_ID);
    }
    @PostMapping("/insertIncomeItemInfo")
    public Result<String> insertIncomeItemInfo(@RequestBody IncomeItemInfo incomeItemInfo){
        System.out.println(incomeItemInfo.toString());
        return iiisi.insertIncomeItemInfo(incomeItemInfo);
    }
    @PostMapping("/selectAllIncomeItemInfo")
    public Result<List<IncomeItemInfo>> selectAllIncomeItemInfo(@Param("pageSize")Integer pageSize, @Param("pageNum")Integer pageNum){
        return iiisi.selectAllIncomeItemInfo(pageSize, pageNum);
    }
    @PostMapping("/selectIncomeItemInfo")
    public Result<List<IncomeItemInfo>> selectIncomeItemInfo(@RequestBody Map<String, Object> params){
        System.out.println("Controller" + params.toString());
        return iiisi.selectIncomeItemInfo(params);
    }
    @PostMapping("/updateIncomeItemInfo")
    public Result<String> updateIncomeItemInfo(@RequestBody IncomeItemInfo incomeItemInfo){
        return iiisi.updateIncomeItemInfo(incomeItemInfo);
    }
}
